﻿@{
    Layout = null;
    string userId = CookieHelper.GetCookieValue("UserId");
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>奔驰主页</title>
    <script src="~/Scripts/jquery-1.8.2.js"></script>
</head>
<body>
    <div>
        登录成功然后进入的主页
    </div>
    <input id="btn_ajax" type="button" value="Ajax请求" />
    <a href="javascript:LoginOut()">注销</a>
    <script type="text/javascript">
        function LoginOut() {
            $.ajax({
                type: "Post",
                url: "/benz/loginout",
                dataType: "Json",
                async: false,
                success: function (objInvokeResult) {
                    alert(objInvokeResult.ResultMessage);
                    if (objInvokeResult.ResultCode == "Success") {
                        window.location.reload();
                    }
                }
            });
        }
        $("#btn_ajax").click(function () {
            $.ajax({
                type: "Get",
                url: "/benz/ajaxdata",
                dataType: "Json",
                async: false,
                success: function (objInvokeResult) {
                    alert(objInvokeResult.ResultMessage);
                }
            });
        });
    </script>
</body>
</html>
